<template>
  <span style="color:red">
    <i class="lefticon el-icon-share"></i>
    <h5 style="display:inline-block;color:gray;">{{text}}</h5>
  </span>
</template>
<script>
import { get } from "../request";
import { mapActions } from 'vuex';
export default {
  data() {
    return {};
  },
  props: {
    text: {
      type: String,
      default: "Vue 后台管理系统"
    }
  },
  created() {
    this.$on("myevent", this.handleCreated);
    this.getDay();
  },
  methods: {
    handleCreated(e) {
      console.log(e);
    },
    handleClick(e) {
      console.log(e);
      this.$emit("myevent", "$emit-argument");
    },
    getDay() {
      get(
        "https://api.ooopn.com/ciba/api.php",
        (res, err) => {
          console.log(res.data);
          this.text = res.data["ciba-en"];
          this.setEveryDay(res.data);
        },
        err => {
          console.log(err);
        }
      );
    },
    ...mapActions('user',{
        setEveryDay:'setEveryDay'
    })
  }
};
</script>
<style scoped>
.lefticon {
  color: rgb(55, 56, 55) !important;
  font-size: 30px;
  padding-right: 20px;
}
h3 {
  font-size: 25px;
  color: #636a70 !important;
  letter-spacing: 5px;
}
</style>